import React, { Component } from 'react'

export class tab extends Component {
  render() {
      const {list,tab,i}=this.props
    return (
      <div>
           <ul className='tab'>
            {
              list.length ?list.map((item,index)=>{
                return <li key={index}className={ index===i ?'on':'' } onClick={()=>{
                   tab(index)
                }
                   
                } > <span> {item.title}</span> </li>
              }) :'暂无数据'
            }
        </ul>


      </div>
    )
  }
}

export default tab